//
//  Find_Content_Button.m
//  SoundPill
//
//  Created by 宋旭东 on 15/6/11.
//  Copyright (c) 2015年 宋旭东. All rights reserved.
//

#import "Find_Content_Button.h"

@implementation Find_Content_Button
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}
- (void)createSubviews
{
    self.cover = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.width)];

    [self addSubview:_cover];
    
    self.workName = [[UILabel alloc] initWithFrame:CGRectMake(0, _cover.frame.size.height, self.frame.size.width, (self.frame.size.height - self.frame.size.width) * 0.4)];
    _workName.font = [UIFont systemFontOfSize:12];
    _workName.textAlignment = NSTextAlignmentLeft;

    [self addSubview:_workName];
    
    self.playImage = [[UIImageView alloc] initWithFrame:CGRectMake(-5, _workName.frame.origin.y + _workName.frame.size.height -3, (self.frame.size.height - self.frame.size.width) * 0.28, (self.frame.size.height - self.frame.size.width) * 0.28)];
//    _playImage.backgroundColor = [UIColor redColor];
    _playImage.image = [UIImage imageNamed:@"play_gray_button"];
    [self addSubview:_playImage];
    
    self.playCount = [[UILabel alloc] initWithFrame:CGRectMake(_playImage.frame.size.width - 6, _playImage.frame.origin.y, (self.frame.size.height - self.frame.size.width) * 0.453, _playImage.frame.size.width)];
    
    self.playCount.font = [UIFont systemFontOfSize:10];
    _playCount.textColor = [UIColor colorWithRed:0.600f green:0.600f blue:0.600f alpha:1.00f];
    [self addSubview:_playCount];
    
    self.loveImage = [[UIImageView alloc] initWithFrame:CGRectMake(_playCount.frame.origin.x + _playCount.frame.size.width - 5, _playImage.frame.origin.y, _playImage.frame.size.width, _playImage.frame.size.height)];
    _loveImage.image = [UIImage imageNamed:@"love_gray_button"];
    [self addSubview:_loveImage];
    
    self.loveCount = [[UILabel alloc] initWithFrame:CGRectMake(_loveImage.frame.origin.x + _loveImage.frame.size.width, _loveImage.frame.origin.y, _playCount.frame.size.width+1, _playCount.frame.size.height)];
    _loveCount.textColor = [UIColor colorWithRed:0.600f green:0.600f blue:0.600f alpha:1.00f];
    _loveCount.font = [UIFont systemFontOfSize:10];

    [self addSubview:_loveCount];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
